Skip to main content

Kwikfit IPP exports

Introduction

For a specific supplier group, compile a list of authorised job lines in ViSN where the enquiry status is either "Authorised" or "Partially Authorised.".

Purpose

Kwikfit currently adds authorised job lines manually into their backend system, IPP. To streamline this process, a file is generated daily containing all authorised jobs from the past 24 hours, formatted specifically to meet the requirements of Kwikfit's IPP system.

File format

each column is separated by a comma

File Naming Convention

VISN<space><space><space><space><space><YYYY><mm><dd>01.ath
example: VISN     2025101801.ath

Fields

ColumnFieldTypeLengthCommentMandatoryExample
ASourceText10default to 5Yes5
BCustCustText10Kwikfit provides a reference code for each lease company. This code must be obtained directly from Kwikfit for every lease company. All SAVi Paybill customers use a common reference ID. If no mapping exists in ViSN for a specific lease company, export an empty value.NoP1372D
CAuthorisation DateDate10DD/MM/YYYY - The last authorisation date from the enquiry level. For enquiries with multiple job lines authorised on different dates, use the most recent authorisation date for all job lines.Yes21/09/2021
DAuthorisation NumberText20Enquiry number in ViSNYes57078
ECard NumberText20empty valueNo
FRegistration NumberText20VRM for this enquiryYesYH17HHB
GMerchant NumberText20Empty valueNo
HMileageNumber(9,0)9Mileage saved against this enquiryNo10675
IPart IDText20For MOT, use MOT, else use Job description of the job line. (truncated to 20 characters) YesBR235/55V18TUR6, 20000 Mile Service (
JQuantityNumber(9,2)12for Tyre use tyre.quantity else default to 1Yes1
KPart NetNumber(9,2)12MOT → cost.value else job line total. Formatted to 2 decimal placesYes249.99
LKF FitterText20For supplier Id "859", use "008". For all other supplier IDs, use "001".No008
MKF Depot CodeText15The root level supplier Id associated with the job lineYes859

Data storage process

Save Job line data

  1. When the enquiry status transitions to Authorised or Partially Authorised.
  2. Verify the authorisedTransactionExport value for the enquiry's group.
  3. If the value is true, save the required fields under ancillary/exports/kwikfitTransactionsExport/{accountId}/authorised/{enquiryId}.
  4. If the value is false, do not save the data.

Delete Job line data

  1. When the enquiry status transitions to anything other than Authorised or Partially Authorised.
  2. Verify the authorisedTransactionExport value for the enquiry's group.
  3. If the value is true, delete this enquiry ancillary/exports/kwikfitTransactionsExport/{accountId}/authorised/{enquiryId}.
  4. If the value is false, exit the process

Location of the data

  • Ensure lease export root exists (created when missing):
    • ancillary/exports/kwikfitTransactionsExport/{accountId}
  • Save the individual enquiry transaction at:
    • ancillary/exports/kwikfitTransactionsExport/{accountId}/authorised/{enquiryId}

Export scheduler and configuration

  • The export is triggered by a scheduler that is triggered at a predefined time.
  • The scheduler reads a JSON payload with the following fields:
    • accountId → Supplier Group for which to generate the export
    • recipientEmailList → Comma-separated email list to receive the exported file
    • forPastHours → Time window (in hours) to fetch authorised transactions generated in the past hours

Example payload:

{
"accountId": "RMZj6hYyP4PqhobUm1zw",
"recipientEmailList": "recipient@email.com",
"forPastHours": 24
}

An export file will be created for the account ID "RMZj6hYyP4PqhobUm1zw," containing enquiries authorised within the last 24 hours. Once the file is generated, it will be emailed to recipient@email.com.

Generating the file

Data Retrieval

  • Query: ancillary/exports/kwikfitTransactionsExport/{accountId}/authorised
  • Filter: updatedTimestamp >= (now - forPastHours)
  • Streams matching docs and collects csvLines from each document
  • newline character is CRLF

File Upload

  • Destination bucket: Google Cloud Storage
  • Path: ${accountId}/billing/${year}/${month}/${date}/{file-name-generated-in-above-step}
  • Content-Type: text/plain

Email Notifications

  • When data exists: send SUPPLIER_TRANSACTION_REPORT with the file attached
  • When no data: send SUPPLIER_TRANSACTION_REPORT_FAILED
  • Recipients: split recipientEmailList by comma and send to each address
Authored By: Meet Shah on Sep 25, 2025
Modified by: VIshwa Kumar on Oct 19, 2025
Modified by: VIshwa Kumar on Oct 26, 2025 (VN-21652, VN-21723)